package restaurant;

import java.util.Date;

/**
 * The Table UI allows customers to interact with the restaurant system.
 * 
 * @author Odessa
 */

public class TableUI extends UserUI
{

	/** The has ordered. */
	private boolean hasOrdered = false;

	/** The time ordered. */
	private Date timeOrdered;

	/** The order delivered. */
	private boolean orderDelivered = false;

	/** The table number. */
	private int tableNo;



	/**
	 * Instantiates a new table user interface.
	 */
	public TableUI() {
		super();
	}



	/**
	 * Gets the entire menu.
	 * 
	 * @return the entire menu.
	 */
	private String getMenu()
	{
		return system.getMenu();
	}



	/**
	 * Gets the menu by course.
	 * 
	 * @param course the course by which to view the menu.
	 * @return the menu based on the {@code course} entered.
	 */
	private String getMenuByCourse(String course)
	{
		return system.getMenuByCourse(course);
	}



	/**
	 * Gets the menu by preparation time.
	 * 
	 * @param time the preparation time by which to view the menu.
	 * @return the menu based on the {@code prepTime} entered.
	 */
	private String getMenuByPrepTime(int time)
	{
		return system.getMenuByPrepTime(time);
	}



	/**
	 * Gets the menu by price.
	 * 
	 * @param price the price by which to view the menu.
	 * @return the menu by price based on the {@code price} entered.
	 */
	private String getMenuByPrice(int price)
	{
		return system.getMenuByPrice(price);
	}



	/**
	 * Gets the menu by rating.
	 * 
	 * @param rating the rating by which to view the menu.
	 * @return the menu based on the {@code rating} entered.
	 */
	private String getMenuByRating(int rating)
	{
		return system.getMenuByRating(rating);
	}



	/**
	 * Gets the vegetarian menu.
	 * 
	 * @return the menu containing only vegetarian items.
	 */
	private String getMenuByVegetarian()
	{
		return system.getMenuByVegetarian();
	}



	/**
	 * Places an order for an item.
	 * 
	 * @param item the item being ordered.
	 * @param price the price of the item being ordered.
	 */
	private void orderItem(int item, double price)
	{
		system.orderItem(tableNo, item, price);
	}



	/**
	 * Rates a menu item.
	 * 
	 * @param item the menu item being rated.
	 * @param rating the rating for the item.
	 * @param comment the comment for the item.
	 */
	private void rateItem(int item, int rating, String comment)
	{
		system.rateItem(item, rating, comment);
	}



	/**
	 * Adds a comment.
	 * 
	 * @param comment the comment to add.
	 */
	private void addComment(String comment)
	{
		system.addComment(comment);
	}



	/**
	 * Views the tab for this table.
	 * 
	 * @return the tab for this table.
	 */
	private String viewTab()
	{
		return system.viewTab(tableNo);
	}



	/**
	 * Pays this table's tab.
	 * 
	 * @param cardNumber the credit card used to pay the tab.
	 * @param expiration the expiration date of the credit card.
	 * @return String stating whether or not the tab was successfully paid.
	 */
	private String payTab(String cardNumber, Date expiration)
	{
		return system.payTab(tableNo, cardNumber, expiration);
	}



	/**
	 * Places a request so that the wait person can come to the table.
	 */
	private void requestService()
	{
		system.requestService(tableNo);
	}



	/**
	 * Activates the table.
	 * 
	 * @param pin the pin to activate the table.
	 * @return String stating whether or not the table was successfully
	 *         activated.
	 */
	private String activate(int pin)
	{
		return system.activateTable(tableNo, pin);
	}



	/**
	 * Resets this table once the customer has left.
	 */
	private void reset()
	{
		system.reset(tableNo);
	}
}
